package com.tboss.template.admin.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.tboss.template.admin.service.AdminService;

@Controller
@RequestMapping(value = "/template/admin")
public class AdminController {
	
	@Autowired private AdminService adminService;
	
	@RequestMapping(value = {"/main"}, method = {RequestMethod.GET, RequestMethod.POST})
	public String main(@RequestParam("sysCode") String sysCode, Model model, HttpServletRequest req){
		String rtnUrl = req.getServletPath().substring(1);
		
		this.adminService.adminMain(sysCode, model);
		
		return rtnUrl+"Ajax";
	}

}
